-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update weighting for the Aggregate score based on WEO2023 #327
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #327 +/- ##
=====================================
Coverage 9.69% 9.69%
=====================================
Files 27 27
Lines 2187 2187
=====================================
Hits 212 212
Misses 1975 1975 ☔ View full report in Codecov by Sentry. |
thanks @Antoine-Lalechere. Reviewing now. If you want to use a path to azure storage instead of your local path, I don't think that this is possible. We could add a location of the file in a comment maybe. @jdhoffa do you have any input here? |
Yeah, I would just comment the line out, and add a comment pointing to the relevant file on azure |
More specifically, here: |
The last link did not work for me @jdhoffa. Should it work in a browser? My experience with azure is that you can point to a directory but not a specific file. So you need to give a file location in the directory next to the link in the comment. |
In general, I would prefer that this dataset is an external dataset created in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall works, I run it locally and got a correct plot. However, it would be preferred if the path to file is generalized, for example to "PATH/TO/SCENARIO/EXTENDED/DATA" or whatever other name would be the most accurate and then in the comment there was a link to azure where the file is located (potentially with the exact description of the location and name of the file as I am not sure if you can link directly to a file).
Closes #318 |
Hmm indeed, it doesn't work for me either that's odd... that is the URL i get as a result of "copy link", but anyway, the files are here: and the specific file is: I suppose so long as those two pieces of information are tracked for posterity, we are good |
@MonikaFu @Antoine-Lalechere I leave it to you two to decide exactly how you want to achieve that. |
@jdhoffa I requested a review from you since it was me who finished the PR in the end and I don't want to be reviewing my own code 🙃 FYI @Antoine-Lalechere |
data-raw/remaining_carbon_budgets.R
Outdated
carbon_emissions <- carbon_emissions[-5,] | ||
carbon_emissions <- carbon_emissions[-5,] | ||
carbon_emissions <- carbon_emissions[-5,] | ||
carbon_emissions <- carbon_emissions[-5,] | ||
carbon_emissions <- carbon_emissions[-5,] | ||
carbon_emissions <- carbon_emissions[-5,] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's probably a more readable/ interpretable way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this
data-raw/remaining_carbon_budgets.R
Outdated
|
||
remaining_carbon_budgets <- carbon_emissions %>% | ||
mutate( | ||
remaining_carbon_budget = emissions_2022 * 4 + emissions_2030 * 4, # remaining carbon dbusget is the interpolized carbon budget until 2030 for a sector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we multiply by 4? Please add a comment to explain what is going on there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are searching the remaining carbon budget between 2022 and 2030, so we are interpolating the carbon budget from 2022 and 2030 and we multiply each one by 4 to account for the intermediate year (2023 to 2029)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Antoine-Lalechere do we include both 2022 and 2030 in the calculation? Or we start from 2023? (I assume the latter, otherwise we'd be missing one year) Do I understand correctly then that we assume emissions assigned to years 2023-2026 are assumed to be the same as those in 2022 and those for 2027-2030 are assumed to be equal to 2030? It is a bit of a strange interpolation tbh. Is there any reason why we do it this way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do an interpolation of carbon budget (so we have a line for carbon budget by sector between 2022 and 2030)
Then 2023 + 2029 carbon budget sums together and are equal to 2022 + 2030 carbon budget
same for 2024 + 2028 etc...
I think I forgot a year, it should be 4.5 and not 4 in the formula
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think I understand. In the end after I run some calculations it seems that the sum of linearly interpolated points is the same as what you are doing here. The only unresolved question is if we should be using 2022 or not? Should we? Aren't we using data from 2023 to 2030 for the calculation?>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The data we get is from 2022 so we have to consider it
Formula should actually be:
remaining_carbon_budget = emissions_2022 * 4.5 + emissions_2030 * 4.5,
This won't change the results as we take then percentage
Updating scenario source and scenario for executive summary calculations. Aligned with what the team decided to use. - [x] depends on RMI-PACTA/pacta.executive.summary#325 - [x] depends on RMI-PACTA/pacta.executive.summary#327 --------- Co-authored-by: Jackson Hoffart <[email protected]>
@jdhoffa @MonikaFu
here are the lines of code to update the weighting for WEO2023 for the Aggregate Score.
Scenario raw data are stored on the following link in Azure but I don't know how to link Azure and GH, so the link used is on my machine for now - can you help me with it? https://portal.azure.com/#view/Microsoft_Azure_FileStorage/FileShareMenuBlade/~/browse/storageAccountId/%2Fsubscriptions%2Ffeef729b-4584-44af-a0f9-4827075512f9%2FresourceGroups%2FRMI-SP-PACTA-PROD%2Fproviders%2FMicrosoft.Storage%2FstorageAccounts%2Fpactarawdata/path/scenario-sources/protocol/SMB